-- GENERATED SPELL FOR [Pygmy Tide Crawler] --


function spell0_2231(pUnit, Event) --@Claw,n/a--
pUnit:FullCastSpellOnTarget(16828,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2231', 665, 1)
end

function spell1_2231(pUnit, Event) --@Cower,n/a--
pUnit:FullCastSpellOnTarget(1742,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2231', 0, 1)
end

function spell2_2231(pUnit, Event) --@Growl,n/a--
pUnit:FullCastSpellOnTarget(14916,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2231', 0, 1)
end

function spell3_2231(pUnit, Event) --@Pin,n/a--
pUnit:FullCastSpellOnTarget(50245,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2231', 4000, 1)
end

function Sorts_2231(pUnit, Event)
local choix_sorts_2231 = math.random(0, 3)
if choix_sorts_2231 == 0 then
pUnit:RegisterEvent('spell0_2231', 1, 1)
end
if choix_sorts_2231 == 1 then
pUnit:RegisterEvent('spell1_2231', 1, 1)
end
if choix_sorts_2231 == 2 then
pUnit:RegisterEvent('spell2_2231', 1, 1)
end
if choix_sorts_2231 == 3 then
pUnit:RegisterEvent('spell3_2231', 1, 1)
end
end

function mob2231_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2231', math.random(1500, 3000), 1)
end

function mob2231_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2231_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2231_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2231, 1, 'mob2231_Action')
RegisterUnitEvent(2231, 2, 'mob2231_Leave')
RegisterUnitEvent(2231, 3, 'mob2231_Kill')
RegisterUnitEvent(2231, 4, 'mob2231_Die')
